package com.xys.auth.bean;

import com.xys.auth.utils.DateTimeUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Product {
    private String id;

    private String productNum;

    private String productName;

    private String cityName;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date departureTime;

    private String productPrice;

    private String productDesc;

    private Integer productStatus;

    private String departureTimeStr;

    private String productStatusStr;

    public String getDepartureTimeStr(){
        return DateTimeUtils.castToDateStr(departureTime,"yyyy-MM-dd HH:mm");
    }
    public String getProductStatusStr(){
        if(productStatus == 1){
            return "开启";
        }else {
            return "关闭";
        }
    }

}
